package cn.edu.scau.cmi.chenruilin.composite.safe;

import java.util.ArrayList;

public class SafeComposite extends SafeComponent{
	
	private String name;
	private ArrayList<SafeComponent> children = new ArrayList<SafeComponent>();
	

	@Override
	public SafeComponent getParent() {
		return this.getParent();
	}
	
	public SafeComponent addChild(SafeComponent child){
		children.add(child);
		return this;
	}
	
	public SafeComponent removeChild(SafeComponent child){
		children.remove(child);
		return this;
	}
	
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public ArrayList<SafeComponent> getChildren() {
		return children;
	}

}
